class AnimalTest {
    private name: string;
    constructor(theName: string) { this.name = theName; }
}

class Rhino extends AnimalTest {
    constructor() { super("Rhino"); }
}

class EmployeeTest {
    private name: string;
    constructor(theName: string) { this.name = theName; }
}

let animal = new AnimalTest("Goat");
let rhino = new Rhino();
let employee = new EmployeeTest("Bob");

animal = rhino;
animal = employee; // 错误: Animal 与 Employee 不兼容.